1. Technical Field
The present invention relates to a method and system for recording data on a recording medium in general, and in particular to a method and system for writing data on a magnetic tape.
2. Description of the Related Art
A magnetic tape recording device can provide data backup for a network system or data base system. Magnetic tape recording devices are commonly referred to as tape storage. One drawback of magnetic tape recording devices is that random access cannot be performed on the devices and a long time is required to write and read data to and from the devices. However, magnetic tape recording devices, unlike hard disk drives, seldom crash to become unusable and hence very reliable. Further, magnetic tape recording device is relatively inexpensive. As such, magnetic tape recording devices are still being widely used for data backup.
There are various types of magnetic tapes of which a cartridge type is commonly used. Usually, the magnetic tape recording device is connected to a network attached storage (NAS) or a computer through a SCSI port or a fiber channel port. The magnetic tape recording device has a property that when data are overwritten with new data on a magnetic tape, all data recorded at the positions subsequent to the position at which the new data are written are deleted.
FIG. 10 shows a magnetic tape 91 on which data A1, A2, A3 to An are recorded. These data are successively written and recorded on the magnetic tape 91 in the order of A1, A2, A3 to An. It is assumed that daily available data used daily are recorded on the magnetic tape 91, such as customer data A1, sales data A2, and customer claim data A3. It is also assumed that the data are backed up after daily business hours and the magnetic tape 91 is replaced when the capacity of the magnetic tape 91 becomes small (usually, the magnetic tape is replaced when data are updated at predetermined times on the basis of a rough estimate from the amount of data updated daily).
Consider a case when an error is found in the data contents of A2 which is then corrected and overwritten. The magnetic tape 91 is loaded in a recording device and the data A2 are read out on a terminal to correct the error. FIG. 11 shows a state where the data A2 is overwritten on the magnetic tape 91 of FIG. 10. In the recording device using the magnetic tape 91, all the data A3 and subsequent data are deleted when the data A2 are overwritten. That is, as shown in FIG. 11, the overwriting of the data A2 causes the data A3 to An to be deleted.
When the overwriting (rewriting) of the contents of the data A2 is carried out under the state that the data A1 to An are recorded on the magnetic tape, the data A3 and subsequent data, that is, the data A3 to An are automatically deleted. Such an operation is carried out to prevent occurrence of a situation described in detail below. From a structural limitation standpoint, the magnetic tape cannot perform an operation of writing a piece of data at a random position (although it is not impossible to write a piece of data at a random position, it is impractical to do so because the rotational speed of the magnetic tape has a limit, resulting in a longer write time). Therefore, data are written on a magnetic tape sequentially from its start portion toward its end portion. Accordingly, when an overwriting operation is carried out on data recorded at some midpoint of the magnetic tape, the overwriting would extend to an area storing the next data if the overwriting data volume is larger than the original data volume before the overwriting.
FIG. 12 shows a state in which the original data A2 written on the magnetic tape 91 are overwritten, and a leading portion of the data A3 is deleted because the amount of overwriting data is large. Thus, it is no longer possible to read out the data A3. Particularly, since information such as data name is written at the leading portion or header of the data, it becomes impossible to identify and access the data if the header portion is deleted. Further, if the header of the data A3 is deleted and a computer attempting to read cannot recognize the data A3, the following problem would occur. That is, when the newly overwritten data A2 is read out, a part of the data A3 is also read out after the data A2, and thus the overwritten data A2 cannot be read out correctly.
In order to prevent occurrence of such a situation, the magnetic tape recording device is designed to delete the data A3 to An when the data A2 is overwritten. Such deletion occurs even when the data A2 is slightly modified. Further, when the magnetic tape recording device is shared by multiple users, new data might be accidentally written on the data A2 which should be left intact.
One method for preventing occurrence of the situation described above may be the one which prohibits any subsequent data writing once data are written. For example, the magnetic tape itself may be write-protected. With such method, however, when the amount of written data is small, an unused portion of the magnetic tape is wasted. Also, with such method, many users cannot share the magnetic tape. Further, with such method, even when multiple magnetic tapes are provided so that multiple users can use them, unused portions of these magnetic tapes would be large and thus wasteful. In addition, with such method, write protection of a magnetic tape has to be set one by one at the recording device side that is inconvenient when the recording device is placed in another room.
Consequently, it would be desirable to provide an improved method for storing data in a magnetic tape recording device.